<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>59_箭头函数返回值</title>
		<script>
			/* 
			箭头函数的返回值可以直接写在箭头后,前提是箭头函数体只有只有一条语句；
				注意：如果直接在箭头后设置对象字面量为返回值时，对象字面量必须使用()括起来,否则返回的是undefined
			
			 */
			// const sum = (a, b) => {
			// 	return a + b;
			// }
			//简写
			const sum = (a, b) => a + b;
			let ret = sum(11, 56);
			console.log("ret=", ret);

			//const fn = () => { name: "孙悟空" } //返回的是undefined
			const fn=()=>({name:"孙悟空",age:11})
			let result = fn();
			console.log(result)
		</script>
	</head>
	<body>
	</body>
</html>